package com.hziee.mail.model;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "product_image_info", schema = "mall", catalog = "")
public class ProductImageInfoEntity {
    private int pImageId;
    private String pImagePath;
    private String productClassId;
    private Timestamp pImageTime;
    private byte pImageMain;

    @Id
    @Column(name = "p_image_id")
    public int getpImageId() {
        return pImageId;
    }

    public void setpImageId(int pImageId) {
        this.pImageId = pImageId;
    }

    @Basic
    @Column(name = "p_image_path")
    public String getpImagePath() {
        return pImagePath;
    }

    public void setpImagePath(String pImagePath) {
        this.pImagePath = pImagePath;
    }

    @Basic
    @Column(name = "product_class_id")
    public String getProductClassId() {
        return productClassId;
    }

    public void setProductClassId(String productClassId) {
        this.productClassId = productClassId;
    }

    @Basic
    @Column(name = "p_image_time")
    public Timestamp getpImageTime() {
        return pImageTime;
    }

    public void setpImageTime(Timestamp pImageTime) {
        this.pImageTime = pImageTime;
    }

    @Basic
    @Column(name = "p_image_main")
    public byte getpImageMain() {
        return pImageMain;
    }

    public void setpImageMain(byte pImageMain) {
        this.pImageMain = pImageMain;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ProductImageInfoEntity that = (ProductImageInfoEntity) o;
        return pImageId == that.pImageId &&
                pImageMain == that.pImageMain &&
                Objects.equals(pImagePath, that.pImagePath) &&
                Objects.equals(productClassId, that.productClassId) &&
                Objects.equals(pImageTime, that.pImageTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pImageId, pImagePath, productClassId, pImageTime, pImageMain);
    }
}
